﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
using SharingCenter.Web.Classes;

namespace SharingCenter.Web.Services
{
    /// <summary>
    /// Summary description for GetLearningSkillXml
    /// </summary>
    public class GetLearningSkillXml : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/xml";
            string ret = "";
            string xmlPath = context.Server.MapPath(WebConsts.APPDATA_DIR + "/Skills.xml");
            using (FileStream fs = File.OpenRead(xmlPath))
            {
                using (StreamReader sr = new StreamReader(fs))
                {
                    ret = sr.ReadToEnd();
                }
            }

            context.Response.Write(ret);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}